﻿Public Class Table_Button
    Protected m_ID As Long
    Public Sub New(ByVal ID As Long, ByVal bTable As Boolean)
        InitializeComponent()

        m_ID = ID
        Dim Img As New Image
        If bTable Then
            Img.Source = New BitmapImage(New Uri("/Images/Table.PNG", UriKind.Relative))
        Else
            Img.Source = New BitmapImage(New Uri("/Images/UnTable.PNG", UriKind.Relative))
        End If
        ImageGrid.Children.Add(Img)
    End Sub

    Private Sub ButtonX_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles ButtonX.Click
        HallServe.tableorder(m_ID)
        Dim Img As New Image
        If HallServe.GetTableUsed(m_ID) Then
            Img.Source = New BitmapImage(New Uri("/Images/Table.PNG", UriKind.Relative))
        Else
            Img.Source = New BitmapImage(New Uri("/Images/UnTable.PNG", UriKind.Relative))
        End If
        ImageGrid.Children.Add(Img)
    End Sub
End Class
